package com.liyunlong.demoliyunlong.shangji2;

import com.liyunlong.demoliyunlong.shangji2.Auas.AsusMonitor;
import com.liyunlong.demoliyunlong.shangji2.Auas.AsusMotherboard;
import com.liyunlong.demoliyunlong.shangji2.Lenovo.LenovoMonitor;
import com.liyunlong.demoliyunlong.shangji2.Lenovo.LenovoMotherboard;
import com.liyunlong.demoliyunlong.shangji2.pojo.Computer;

public class ComputerAssemblyExample {
    public static void main(String[] args) {
        // 组装一台全部来自华硕的电脑
        System.out.println("组装一台全部来自华硕的电脑");
        Computer asusComputer = new Computer.Builder()
              .setMotherboard(new AsusMotherboard())
              .setMonitor(new AsusMonitor())
              .build();
        asusComputer.start();

        System.out.println("***************************************************");
        System.out.println("组装一台全部来自联想的电脑");
        // 组装一台全部来自联想的电脑
        Computer lenovoComputer = new Computer.Builder()
              .setMotherboard(new LenovoMotherboard())
              .setMonitor(new LenovoMonitor())
              .build();
        lenovoComputer.start();
        System.out.println("***************************************************");

        System.out.println("组装一台部分(主板)来自华硕，显示器来自联想的电脑");
        // 组装一台部分来自华硕，部分来自联想的电脑
        Computer mixedComputer = new Computer.Builder()
              .setMotherboard(new AsusMotherboard())
              .setMonitor(new LenovoMonitor())
              .build();
        mixedComputer.start();

        Computer build = new Computer.Builder()
                .setMonitor(new AsusMonitor())
                .setMotherboard(new LenovoMotherboard())
                .build();
        build.start();
    }
}